﻿using UnityEngine;
using System.Collections;

public class LogoSceneScript : MonoBehaviour {
	
	public Transform movingWord;
	float counterBeforStart = 0;
	public Renderer darkScreen;
	Vector3 targetPos;
	
	// Use this for initialization
	void Start () {
		targetPos = new Vector3(2.0f,0.464f,1.774f);
	}
	
	// Update is called once per frame
	void Update () {
		counterBeforStart += Time.deltaTime;
		if(counterBeforStart > 2.0f)
		{
			if(counterBeforStart > 6.0f)
			{
				Color tmpCol = darkScreen.material.color;
				tmpCol.a += Time.deltaTime * 0.4f;
				darkScreen.material.color = tmpCol;
				if(tmpCol.a >= 1.0f)
					Application.LoadLevel("MenuScene");
			}
			movingWord.position = Vector3.Lerp(movingWord.position, targetPos,1.5f * Time.deltaTime);
		}
		
		
		if(Input.GetKeyDown(KeyCode.C))
		{
			PlayerPrefs.DeleteAll();
		}
	}
	
	
}
